
package com.cari.baju.yog;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

import com.cari.baju.yog.utils.Utils;

public class MainActivity extends Activity implements OnClickListener {

    private Button btnCari, btnBantuan, btnTentang;
    private ProgressDialog pDialog;
    private TextView title;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        pDialog = new ProgressDialog(this);
        pDialog.setMessage("Loading...");

        title = (TextView) findViewById(R.id.txt_title);
        btnCari = (Button) findViewById(R.id.btn_pencarian);
        btnBantuan = (Button) findViewById(R.id.btn_bantuan);
        btnTentang = (Button) findViewById(R.id.btn_tentang);

        title.setTypeface(Utils.getCustomFont(this));
        btnCari.setTypeface(Utils.getCustomFont(this));
        btnBantuan.setTypeface(Utils.getCustomFont(this));
        btnTentang.setTypeface(Utils.getCustomFont(this));

        btnCari.setOnClickListener(this);
        btnBantuan.setOnClickListener(this);
        btnTentang.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {

        switch (v.getId()) {
            case R.id.btn_pencarian:

                // masuk ke pencarian
                startActivity(new Intent(this, SearchActivity.class));
                break;
            case R.id.btn_bantuan:
                // masuk ke menu bantuan
                startActivity(new Intent(this, BantuanActivity.class));
                break;
            case R.id.btn_tentang:
                // masuk ke menu tentang
                startActivity(new Intent(this, TentangActivity.class));
                break;

        }
    }

}
